$(document).on("pageInit", "#page-shop-order_settlement_user", function(e, pageId, $page) {
    $(document).on('click', '.J-address', function() {

        location.href = TMPL + "index.php?ctl=shop&act=new_address&address_id=" + data.address_id;
    });
    for(var i=0;i<shop_info.length;i++){
        var obj_shop_info = shop_info[i], goods_obj = {};
        for(var j in obj_shop_info){
            if(j == "goods_id"){
                goods_obj.goods_id = shop_info[i][j];
            }
            if(j == "number"){
                goods_obj.number = shop_info[i][j];
            }
            if(j == "podcast_id"){
                goods_obj.podcast_id = shop_info[i][j];
            }
            if(j == "order_sn"){
                goods_obj.order_sn = shop_info[i][j];
            }
        }
        goods_arr.push(goods_obj);
    };
    var data_shop_arr =  JSON.stringify(goods_arr);
    $(document).on('click', '.J-submit-order', function() {

        if (data.address_id == '') {
            $.toast('地址不能为空', 1000);

        } else {
            location.href = TMPL + "index.php?ctl=pay&act=h5_pay&address_id=" + data.address_id + "&purchase_type=" + data.purchase_type + "&shop_info="+data_shop_arr;
        }

    });
    
});
